package com.rc.saas.mini.controller.format.qrcode;

/**
 * @author wangzhengwei
 * @create 2021/5/11
 */
public enum QrCodeEnum {
    //百城
    BC("397528953",new BcQrCodeFormat()),
    //万马
    WM("321895837",new WmQrCodeFormat());

    private String hlhtOperatorId;
    public QrCodeFormat qrCodeFormat;

    QrCodeEnum(String hlhtOperatorId, QrCodeFormat qrCodeFormat) {
        this.hlhtOperatorId = hlhtOperatorId;
        this.qrCodeFormat = qrCodeFormat;
    }

    /**
     * 是否匹配
     * @param hlhtOperatorId
     * @return
     */
    public static QrCodeEnum match(String hlhtOperatorId){
        QrCodeEnum[] values = QrCodeEnum.values();
        for (QrCodeEnum value:values){
            if(value.hlhtOperatorId.equals(hlhtOperatorId)){
                return value;
            }
        }
        return null;
    }


}
